#include "CONFIG.H"
#include "BUZZER.H"
#include "DELAY.H"

u8 code notes[] = {
	1, 2, 3, 1,				  1, 2, 3, 1,				  3, 4, 5,		3, 4, 5,
	5, 6, 5, 4, 3, 1,		5, 6, 5, 4, 3, 1,		1, 5, 1,		1, 5, 1
};

u8 code durations[] = {
	4, 4, 4, 4,				  4, 4, 4, 4,				  4, 4, 8,		4, 4, 8,
	3, 1, 3, 1, 4, 4,		3, 1, 3, 1, 4, 4,		4, 4, 8,		4, 4, 8
};

void main(){
	u8 len = sizeof(notes) / sizeof(notes[0]);
	u8 i;
	u16 delay;
	
	Buzzer_start();
	
	EA = 1;
	
	for(i = 0;i < len;i++){
		
		Buzzer_been(notes[i]);
		delay = durations[i] * 100;
		
		delay_X_ms(delay);
		Buzzer_stop();
		delay_ms(20);
	}
	Buzzer_stop();
	
	
	while(1){

	}
}